<!DOCTYPE HTML> 
<html> 
<head> 
<meta charset="utf-8" /> 
<title>简单透明度渐变</title> 
</head> 
<style type="text/css">
*{margin:0;padding:0;}
#oDiv{width:200px;height:200px;margin:0 auto;background:#000;}
</style> 
<body>
<div id="oDiv" style="opacity:1;">Lee</div>
</body> 
<script type="text/javascript">
window.onload = function(){
var timer = setInterval(colorLiner,200);
var val = 100;
function colorLiner(){
if(val >= 0){
var oDiv = document.getElementById('oDiv');
oDiv.style.opacity = val/100;
val--;
}
}
}
</script>
</html>